package com.ruoyi.course.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.course.mapper.SHomeworkOptionMapper;
import com.ruoyi.course.domain.SHomeworkOption;
import com.ruoyi.course.service.ISHomeworkOptionService;

/**
 * 学生作业选项Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-01
 */
@Service
public class SHomeworkOptionServiceImpl implements ISHomeworkOptionService 
{
    @Autowired
    private SHomeworkOptionMapper sHomeworkOptionMapper;

    /**
     * 查询学生作业选项
     * 
     * @param id 学生作业选项主键
     * @return 学生作业选项
     */
    @Override
    public SHomeworkOption selectSHomeworkOptionById(Long id)
    {
        return sHomeworkOptionMapper.selectSHomeworkOptionById(id);
    }

    /**
     * 查询学生作业选项列表
     * 
     * @param sHomeworkOption 学生作业选项
     * @return 学生作业选项
     */
    @Override
    public List<SHomeworkOption> selectSHomeworkOptionList(SHomeworkOption sHomeworkOption)
    {
        return sHomeworkOptionMapper.selectSHomeworkOptionList(sHomeworkOption);
    }

    /**
     * 新增学生作业选项
     * 
     * @param sHomeworkOption 学生作业选项
     * @return 结果
     */
    @Override
    public int insertSHomeworkOption(SHomeworkOption sHomeworkOption)
    {
        sHomeworkOption.setCreateTime(DateUtils.getNowDate());
        return sHomeworkOptionMapper.insertSHomeworkOption(sHomeworkOption);
    }

    /**
     * 修改学生作业选项
     * 
     * @param sHomeworkOption 学生作业选项
     * @return 结果
     */
    @Override
    public int updateSHomeworkOption(SHomeworkOption sHomeworkOption)
    {
        sHomeworkOption.setUpdateTime(DateUtils.getNowDate());
        return sHomeworkOptionMapper.updateSHomeworkOption(sHomeworkOption);
    }

    /**
     * 批量删除学生作业选项
     * 
     * @param ids 需要删除的学生作业选项主键
     * @return 结果
     */
    @Override
    public int deleteSHomeworkOptionByIds(Long[] ids)
    {
        return sHomeworkOptionMapper.deleteSHomeworkOptionByIds(ids);
    }

    /**
     * 删除学生作业选项信息
     * 
     * @param id 学生作业选项主键
     * @return 结果
     */
    @Override
    public int deleteSHomeworkOptionById(Long id)
    {
        return sHomeworkOptionMapper.deleteSHomeworkOptionById(id);
    }
}
